import request from '@/utils/request'

// 查询会员列表
export function listForm(query) {
  return request({
    url: '/project/wtc/form/list',
    method: 'get',
    params: query
  })
}

// 查询会员详细
export function getForm(id) {
  return request({
    url: '/project/wtc/form/' + id,
    method: 'get'
  })
}

// 新增会员
export function addForm(data) {
  return request({
    url: '/project/wtc/form',
    method: 'post',
    data: data
  })
}

// 修改会员
export function updateForm(data) {
  return request({
    url: '/project/wtc/form',
    method: 'put',
    data: data
  })
}

// 删除会员
export function delForm(id) {
  return request({
    url: '/project/wtc/form/' + id,
    method: 'delete'
  })
}

// 注销会员
export function delForms(id) {
  return request({
    url: '/project/wtc/form/del/' + id,
    method: 'delete'
  })
}

// 激活会员
export function activeCard(ids) {
  return request({
    url: '/project/wtc/form/active',
    method: 'post',
    data: ids
  })
}

// 会员卡销售查询
export function sell(startTime, endTime) {
  // let param = [startTime, endTime]
  let param = {startTime: startTime, endTime: endTime}
  return request({
    url: '/project/wtc/form/sell',
    method: 'post',
    // dataType: "json",
    data: param
  })
}

// 开户续款报表查询
export function open(startTime, endTime, cardNumber, cardSeller, cardNature) {
  let param = {
    startTime: startTime,
    endTime: endTime,
    cardNumber: cardNumber,
    cardSeller: cardSeller,
    cardNature: cardNature
  }
  return request({
    url: '/project/wtc/form/open',
    method: 'post',
    data: param
  })
}

// 销户报表查询
export function delA(startTime, endTime, cardNumber, cardSeller, cardNature) {
  let param = {
    startTime: startTime,
    endTime: endTime,
    cardNumber: cardNumber,
    cardSeller: cardSeller,
    cardNature: cardNature
  }
  return request({
    url: '/project/wtc/form/del',
    method: 'post',
    data: param
  })
}
